package cn.com.czpb.client.model.news;

import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.google.gson.annotations.SerializedName;

import org.litepal.crud.DataSupport;

import java.io.Serializable;
import java.util.List;

/**
 * Created by 猪猪侠 on 2017/7/4.
 */

public class NewsBean extends DataSupport implements Serializable, MultiItemEntity {
    public static final int THREEPIC=4;
    public static final int LEFTPIC=2;
    public static final int NOPIC=1;

    public static final int SCROLLNEWS=6;
    public static final int SCROLLSUBSCRIBE=7;
//    public static final int VIDEOBIG=5;//视频样式
//    public static final int BIGPIC=8;
    public static final int BIGPIC=5;
    public static final int VIDEOBIG=8;//视频样式


    /**
     * rtype : 1
     * rvalue :
     * nid : 64313
     * tid : 245
     * title : 国务院举行宪法宣誓仪式 李克强监誓
     * copyfrom : 人民网
     * comcount : 0
     * viewnum : 49
     * praisecount : 1
     * sort_order : 1499136778.00
     * status : 0
     * create_time : 1499136530
     * type : 2
     * sid : 0
     * comflag : 1
     * columnid : 0
     * outline :
     * voteflag : 0
     * imgs : ["http://zlxw.chinalco.com.cn/zl/Public/Uploads/thumb/1499136576.jpg"]
     * newsurl : http://zlxw.chinalco.com.cn/zl_jhxt/ordos/News/201707/04/64313.html
     * update_time : 10:48
     * istop : 0
     */

    @SerializedName("mediaName")
    private String mediaName;
    @SerializedName("rtype")
    private String rtype;
    @SerializedName("rvalue")
    private String rvalue;
    @SerializedName("nid")
    private String nid;
    @SerializedName("tid")
    private String tid;
    @SerializedName("title")
    private String title;
    @SerializedName("copyfrom")
    private String copyfrom;
    @SerializedName("viewnum")
    private String viewnum;
    @SerializedName("sort_order")
    private String sortOrder;
    @SerializedName("status")
    private String status;
    @SerializedName("create_time")
    private String createTime;
    @SerializedName("type")
    private String type;
    @SerializedName("sid")
    private String sid;
    @SerializedName("comflag")
    private String comflag;
    @SerializedName("columnid")
    private String columnid;
    @SerializedName("outline")
    private String outline;
    @SerializedName("voteflag")
    private String voteflag;
    @SerializedName("newsurl")
    private String newsurl;
    @SerializedName("update_time")
    private String updateTime;
    @SerializedName("istop")
    private String istop;
    @SerializedName("imgs")
    private List<String> imgs;
    @SerializedName("newsflag")
    private String newsflag;
    @SerializedName("comcount")
    private String comcount;
    @SerializedName("praisecount")
    private String praisecount;
    @SerializedName("favoritecount")
    private String favoritecount;
    @SerializedName("videourl")
    private String videourl;

    @SerializedName("content")
    private String content;

    public String getBigimg() {
        return bigimg;
    }

    public void setBigimg(String bigimg) {
        this.bigimg = bigimg;
    }

    @SerializedName("bigimg")

    private String bigimg;

    @SerializedName("medianews")
    private List<MediaNewsBean> medianews;
    public NewsBean(){
        super();
    }
    public NewsBean(MediaNewsBean mediaNewsBean) {
        super();
        this.rtype = mediaNewsBean.getRtype();
        this.rvalue = mediaNewsBean.getRvalue();
        this.nid = mediaNewsBean.getNid();
        this.tid = mediaNewsBean.getTid();
        this.title = mediaNewsBean.getTitle();
        this.copyfrom = mediaNewsBean.getCopyfrom();
        this.viewnum = mediaNewsBean.getViewnum();
        this.sortOrder = mediaNewsBean.getSortOrder();
        this.status = mediaNewsBean.getStatus();
        this.createTime = mediaNewsBean.getCreateTime();
        this.type = mediaNewsBean.getType();
        this.sid = mediaNewsBean.getSid();
        this.comflag = mediaNewsBean.getComflag();
        this.columnid = mediaNewsBean.getColumnid();
        this.outline = mediaNewsBean.getOutline();
        this.voteflag = mediaNewsBean.getVoteflag();
        this.newsurl = mediaNewsBean.getNewsurl();
        this.updateTime = mediaNewsBean.getUpdateTime();
        this.istop = mediaNewsBean.getIstop();
        this.imgs = mediaNewsBean.getImgs();
        this.newsflag = mediaNewsBean.getNewsflag();
        this.comcount = mediaNewsBean.getComcount();
        this.praisecount = mediaNewsBean.getPraisecount();
        this.favoritecount = mediaNewsBean.getFavoritecount();
    }

    public String getMediaName() {
        return mediaName;
    }

    public void setMediaName(String mediaName) {
        this.mediaName = mediaName;
    }

    public String getVideourl() {
        return videourl;
    }

    public void setVideourl(String videourl) {
        this.videourl = videourl;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public List<MediaNewsBean> getMedianews() {
        return medianews;
    }

    public void setMedianews(List<MediaNewsBean> medianews) {
        this.medianews = medianews;
    }

    public String getPraisecount() {
        return praisecount;
    }

    public void setPraisecount(String praisecount) {
        this.praisecount = praisecount;
    }

    public String getFavoritecount() {
        return favoritecount;
    }

    public void setFavoritecount(String favoritecount) {
        this.favoritecount = favoritecount;
    }

    public String getRtype() {
        return rtype;
    }

    public void setRtype(String rtype) {
        this.rtype = rtype;
    }

    public String getRvalue() {
        return rvalue;
    }

    public void setRvalue(String rvalue) {
        this.rvalue = rvalue;
    }

    public String getNid() {
        return nid;
    }

    public void setNid(String nid) {
        this.nid = nid;
    }

    public String getTid() {
        return tid;
    }

    public void setTid(String tid) {
        this.tid = tid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getCopyfrom() {
        return copyfrom;
    }

    public void setCopyfrom(String copyfrom) {
        this.copyfrom = copyfrom;
    }

    public String getComcount() {
        return comcount;
    }

    public void setComcount(String comcount) {
        this.comcount = comcount;
    }

    public String getViewnum() {
        return viewnum;
    }

    public void setViewnum(String viewnum) {
        this.viewnum = viewnum;
    }

    public String getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(String sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getComflag() {
        return comflag;
    }

    public void setComflag(String comflag) {
        this.comflag = comflag;
    }

    public String getColumnid() {
        return columnid;
    }

    public void setColumnid(String columnid) {
        this.columnid = columnid;
    }

    public String getOutline() {
        return outline;
    }

    public void setOutline(String outline) {
        this.outline = outline;
    }

    public String getVoteflag() {
        return voteflag;
    }

    public void setVoteflag(String voteflag) {
        this.voteflag = voteflag;
    }

    public String getNewsurl() {
        return newsurl;
    }

    public void setNewsurl(String newsurl) {
        this.newsurl = newsurl;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getIstop() {
        return istop;
    }

    public void setIstop(String istop) {
        this.istop = istop;
    }

    public List<String> getImgs() {
        return imgs;
    }

    public void setImgs(List<String> imgs) {
        this.imgs = imgs;
    }


    public String getNewsflag() {
        return newsflag;
    }

    public void setNewsflag(String newsflag) {
        this.newsflag = newsflag;
    }

    @Override
    public int getItemType() {
        //ype=1(文字新闻)type=2(图文)type=4(三连图)type=5(大图),
        if ("4".equals(getType())) {
            return THREEPIC;
        }
        if ("1".equals(getType())) {
            return NOPIC;
        }

        if("6".equals(getType())){
            return SCROLLNEWS;
        }
        if("7".equals(getType())){
            return SCROLLSUBSCRIBE;
        }
//        if("5".equals(getType())){
//            return VIDEOBIG;
//        }
//        if ("8".equals(getType())) {
//            return BIGPIC;
//        }
        if("8".equals(getType())){
            return VIDEOBIG;
        }
        if ("5".equals(getType())) {
            return BIGPIC;
        }
        else {
            return LEFTPIC;
        }
    }
}
